﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Client
{
    /// <summary>
    /// A collection of all the ImageArrays that our game will use.
    /// </summary>
    public static class ImageLib
    {
        public static ImageArray Interface;                 // PrgUse.wil/wix
        public static ImageArray CharacterSelect;           // ChrSel.wil/wix
        public static ImageArray HumanImage;                // ChrSel.wil/wix
        public static ImageArray Hair;                      // Hair.wil/wix

        public static ImageArray BigTiles;                  // Tiles.wil/wix
        public static ImageArray SmallTiles;                // SmTiles.wil/wix

        public static ImageArray Objects1;                  // Objects1.wil/wix
        public static ImageArray Objects2;                  // Objects2.wil/wix
        public static ImageArray Objects3;                  // Objects3.wil/wix
        public static ImageArray Objects4;                  // Objects4.wil/wix
        public static ImageArray Objects5;                  // Objects5.wil/wix
        public static ImageArray Objects6;                  // Objects6.wil/wix
        public static ImageArray Objects7;                  // Objects6.wil/wix
        public static ImageArray Objects8;                  // Objects6.wil/wix
        public static ImageArray Objects9;                  // Objects6.wil/wix
        public static ImageArray Objects10;                 // Objects6.wil/wix

        public static ImageArray Monster1;                  // Mon1.wil/wix
        public static ImageArray Monster2;                  // Mon2.wil/wix
        public static ImageArray Monster3;                  // Mon3.wil/wix
        public static ImageArray Monster4;                  // Mon4.wil/wix
        public static ImageArray Monster5;                  // Mon5.wil/wix
        public static ImageArray Monster6;                  // Mon6.wil/wix
        public static ImageArray Monster7;                  // Mon7.wil/wix
        public static ImageArray Monster8;                  // Mon8.wil/wix
        public static ImageArray Monster9;                  // Mon9.wil/wix
        public static ImageArray Monster10;                 // Mon10.wil/wix
        public static ImageArray Monster11;                 // Mon11.wil/wix
        public static ImageArray Monster12;                 // Mon12.wil/wix
        public static ImageArray Monster13;                 // Mon13.wil/wix
        public static ImageArray Monster14;                 // Mon14.wil/wix
        public static ImageArray Monster15;                 // Mon15.wil/wix
        public static ImageArray Monster16;                 // Mon16.wil/wix
        public static ImageArray Monster17;                 // Mon17.wil/wix
        public static ImageArray Monster18;                 // Mon18.wil/wix
        public static ImageArray Monster19;                 // Mon19.wil/wix
        public static ImageArray Monster20;                 // Mon20.wil/wix
        public static ImageArray Monster21;                 // Mon21.wil/wix
        public static ImageArray Monster22;                 // Mon22.wil/wix
        public static ImageArray Monster23;                 // Mon23.wil/wix
        public static ImageArray Monster24;                 // Mon24.wil/wix
        public static ImageArray Monster25;                 // Mon25.wil/wix
        public static ImageArray Monster26;                 // Mon26.wil/wix
        public static ImageArray Monster27;                 // Mon27.wil/wix
        public static ImageArray Monster28;                 // Mon28.wil/wix
        public static ImageArray Monster29;                 // Mon29.wil/wix
        public static ImageArray Monster30;                 // Mon30.wil/wix
        public static ImageArray Monster31;                 // Mon31.wil/wix
        public static ImageArray Monster32;                 // Mon32.wil/wix


        public static void InitializeImageLibraries()
        {
            const InternationalVersion version = InternationalVersion.English;

            Interface = new ImageArray();
            Interface.FileName = "./Data/PrgUse.wil";
            Interface.LibType = LibType.UseCache;
            Interface.InternationalVersion = InternationalVersion.Korean;
            Interface.GraphicsDevice = DirectX.Me.DirectXDevice;
            Interface.Initialize();

            CharacterSelect = new ImageArray();
            CharacterSelect.FileName = "./Data/ChrSel.wil";
            CharacterSelect.LibType = LibType.UseCache;
            CharacterSelect.InternationalVersion = version;
            CharacterSelect.GraphicsDevice = DirectX.Me.DirectXDevice;
            CharacterSelect.Initialize();

            HumanImage = new ImageArray();
            HumanImage.FileName = "./Data/Hum.wil";
            HumanImage.LibType = LibType.UseCache;
            HumanImage.InternationalVersion = version;
            HumanImage.GraphicsDevice = DirectX.Me.DirectXDevice;
            HumanImage.Initialize();

            BigTiles = new ImageArray();
            BigTiles.FileName = "./Data/Tiles.wil";
            BigTiles.LibType = LibType.UseCache;
            BigTiles.InternationalVersion = version;
            BigTiles.GraphicsDevice = DirectX.Me.DirectXDevice;
            BigTiles.Initialize();

            SmallTiles = new ImageArray();
            SmallTiles.FileName = "./Data/SmTiles.wil";
            SmallTiles.LibType = LibType.UseCache;
            SmallTiles.InternationalVersion = version;
            SmallTiles.GraphicsDevice = DirectX.Me.DirectXDevice;
            SmallTiles.Initialize();

            Objects1 = new ImageArray();
            Objects1.FileName = "./Data/Objects.wil";
            Objects1.LibType = LibType.UseCache;
            Objects1.InternationalVersion = version;
            Objects1.GraphicsDevice = DirectX.Me.DirectXDevice;
            Objects1.Initialize();

            Objects2 = new ImageArray();
            Objects2.FileName = "./Data/Objects2.wil";
            Objects2.LibType = LibType.UseCache;
            Objects2.InternationalVersion = version;
            Objects2.GraphicsDevice = DirectX.Me.DirectXDevice;
            Objects2.Initialize();

            Objects3 = new ImageArray();
            Objects3.FileName = "./Data/Objects3.wil";
            Objects3.LibType = LibType.UseCache;
            Objects3.GraphicsDevice = DirectX.Me.DirectXDevice;
            Objects3.InternationalVersion = version;
            Objects3.Initialize();

            Objects4 = new ImageArray();
            Objects4.FileName = "./Data/Objects4.wil";
            Objects4.LibType = LibType.UseCache;
            Objects4.InternationalVersion = version;
            Objects4.GraphicsDevice = DirectX.Me.DirectXDevice;
            Objects4.Initialize();

            Objects5 = new ImageArray();
            Objects5.FileName = "./Data/Objects5.wil";
            Objects5.LibType = LibType.UseCache;
            Objects5.InternationalVersion = version;
            Objects5.GraphicsDevice = DirectX.Me.DirectXDevice;
            Objects5.Initialize();

            Objects6 = new ImageArray();
            Objects6.FileName = "./Data/Objects6.wil";
            Objects6.LibType = LibType.UseCache;
            Objects6.InternationalVersion = version;
            Objects6.GraphicsDevice = DirectX.Me.DirectXDevice;
            Objects6.Initialize();

            Objects7 = new ImageArray();
            Objects7.FileName = "./Data/Objects7.wil";
            Objects7.LibType = LibType.UseCache;
            Objects7.InternationalVersion = version;
            Objects7.GraphicsDevice = DirectX.Me.DirectXDevice;
            Objects7.Initialize();

            Objects8 = new ImageArray();
            Objects8.FileName = "./Data/Objects8.wil";
            Objects8.LibType = LibType.UseCache;
            Objects8.InternationalVersion = version;
            Objects8.GraphicsDevice = DirectX.Me.DirectXDevice;
            Objects8.Initialize();

            Objects9 = new ImageArray();
            Objects9.FileName = "./Data/Objects9.wil";
            Objects9.LibType = LibType.UseCache;
            Objects9.InternationalVersion = version;
            Objects9.GraphicsDevice = DirectX.Me.DirectXDevice;
            Objects9.Initialize();

            Objects10 = new ImageArray();
            Objects10.FileName = "./Data/Objects10.wil";
            Objects10.LibType = LibType.UseCache;
            Objects10.InternationalVersion = version;
            Objects10.GraphicsDevice = DirectX.Me.DirectXDevice;
            Objects10.Initialize();

            // NOTE: Monster Libraries
            Monster1 = new ImageArray();
            Monster1.FileName = "./Data/Mon1.wil";
            Monster1.LibType = LibType.UseCache;
            Monster1.InternationalVersion = version;
            Monster1.GraphicsDevice = DirectX.Me.DirectXDevice;
            Monster1.Initialize();

            Monster2 = new ImageArray();
            Monster2.FileName = "./Data/Mon2.wil";
            Monster2.LibType = LibType.UseCache;
            Monster2.InternationalVersion = version;
            Monster2.GraphicsDevice = DirectX.Me.DirectXDevice;
            Monster2.Initialize();

            Monster3 = new ImageArray();
            Monster3.FileName = "./Data/Mon3.wil";
            Monster3.LibType = LibType.UseCache;
            Monster3.InternationalVersion = version;
            Monster3.GraphicsDevice = DirectX.Me.DirectXDevice;
            Monster3.Initialize();

            Monster4 = new ImageArray();
            Monster4.FileName = "./Data/Mon4.wil";
            Monster4.LibType = LibType.UseCache;
            Monster4.InternationalVersion = version;
            Monster4.GraphicsDevice = DirectX.Me.DirectXDevice;
            Monster4.Initialize();

            Monster5 = new ImageArray();
            Monster5.FileName = "./Data/Mon5.wil";
            Monster5.LibType = LibType.UseCache;
            Monster5.InternationalVersion = version;
            Monster5.GraphicsDevice = DirectX.Me.DirectXDevice;
            Monster5.Initialize();

            Monster6 = new ImageArray();
            Monster6.FileName = "./Data/Mon6.wil";
            Monster6.LibType = LibType.UseCache;
            Monster6.InternationalVersion = version;
            Monster6.GraphicsDevice = DirectX.Me.DirectXDevice;
            Monster6.Initialize();

            Monster7 = new ImageArray();
            Monster7.FileName = "./Data/Mon7.wil";
            Monster7.LibType = LibType.UseCache;
            Monster7.InternationalVersion = version;
            Monster7.GraphicsDevice = DirectX.Me.DirectXDevice;
            Monster7.Initialize();

            Monster8 = new ImageArray();
            Monster8.FileName = "./Data/Mon8.wil";
            Monster8.LibType = LibType.UseCache;
            Monster8.InternationalVersion = version;
            Monster8.GraphicsDevice = DirectX.Me.DirectXDevice;
            Monster8.Initialize();

            Monster9 = new ImageArray();
            Monster9.FileName = "./Data/Mon9.wil";
            Monster9.LibType = LibType.UseCache;
            Monster9.InternationalVersion = version;
            Monster9.GraphicsDevice = DirectX.Me.DirectXDevice;
            Monster9.Initialize();

            Monster10 = new ImageArray();
            Monster10.FileName = "./Data/Mon10.wil";
            Monster10.LibType = LibType.UseCache;
            Monster10.InternationalVersion = version;
            Monster10.GraphicsDevice = DirectX.Me.DirectXDevice;
            Monster10.Initialize();

            Hair = new ImageArray();
            Hair.FileName = "./Data/Hair.wil";
            Hair.LibType = LibType.UseCache;
            Hair.InternationalVersion = version;
            Hair.GraphicsDevice = DirectX.Me.DirectXDevice;
            Hair.Initialize();
        }

        public static void UninitializeImageLibraries()
        {
            Interface.Dispose();
            CharacterSelect.Dispose();
            HumanImage.Dispose();
            Hair.Dispose();

            BigTiles.Dispose();
            SmallTiles.Dispose();

            Objects1.Dispose();
            Objects2.Dispose();
            Objects3.Dispose();
            Objects4.Dispose();
            Objects5.Dispose();
            Objects6.Dispose();
            Objects7.Dispose();
            Objects8.Dispose();
            Objects9.Dispose();
            Objects10.Dispose();

            Monster1.Dispose();
            Monster2.Dispose();
            Monster3.Dispose();
            Monster4.Dispose();
            Monster5.Dispose();
            Monster6.Dispose();
            Monster7.Dispose();
            Monster8.Dispose();
            Monster9.Dispose();
            Monster10.Dispose();
            /*Monster11.Dispose();
            Monster12.Dispose();
            Monster13.Dispose();
            Monster14.Dispose();
            Monster15.Dispose();
            Monster16.Dispose();
            Monster17.Dispose();
            Monster18.Dispose();
            Monster19.Dispose();
            Monster20.Dispose();
            Monster21.Dispose();
            Monster22.Dispose();
            Monster23.Dispose();
            Monster24.Dispose();
            Monster25.Dispose();
            Monster26.Dispose();
            Monster27.Dispose();
            Monster28.Dispose();
            Monster29.Dispose();
            Monster30.Dispose();
            Monster31.Dispose();
            Monster32.Dispose();*/
        }
    }
}